#ifndef MOBILE_H_
#define MOBILE_H_

// #include "gpio/gpio.h"

#include <string>
#include <vector>

//GPIO3_A1 
// #define MOBILE_GPIO_POWER       GPIO0_C1
// #define MOBILE_GPIO_RESET       GPIO2_B1
// #define MOBILE_GPIO_PKEY        GPIO3_A0


class mobileNetwork{
public:
    mobileNetwork();
    int mobilePoweON(void);
private:
    int mobileInit(void);
    int openATuart(void);
    int getSIMInfo(void);
    int getModelStatus(void);
    int getConnectStatus(void);
    int atSend(std::string);
    std::string atRecieve(void);
    int gpioPowerSet(unsigned char value);
    int gpioResetSet(unsigned char value);
    int gpioPKeySet(unsigned char value);
    void *pthreadMobileDeamon(void *arg);

    std::vector<std::string> parseAtResponses(const std::string& input);
    std::string removeWhitespace(const std::string& source);

    struct sp_port *atPort_;
    int powerStatus;
    int signalLevel;
    std::string CCID_;
    std::string CIMI_;
    std::string CGSN_;
};

#endif //MOBILE_H_